<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <meta name="keywords" content="">
    <meta name="description" content="" />
    <meta name="apple-mobile-web-app-title" content="小蝌蚪">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, maximum-scale=1, minimum-scale=1">
    <title>小蝌蚪</title>
    <style>
        .red {
            height: 400px;
            margin-bottom: 20px;
            background-color: red;
        }

        .green {
            height: 800px;
            background-color: green;
        }

        button {
            width: 100px;
            height: 40px;
            background-color: black;
            color: white;
        }
    </style>
</head>

<body>
    <div class="red">
        <button id="btn1" class="xxx yyy">click me1</button>
        <button id="btn2">click me2</button>
    </div>

    <div class="red"></div>

    <div>
        <input name="myInput" type="radio" size="20" /><br />
        <input name="myInput" type="radio" size="20" /><br />
        <input name="myInput" type="radio" size="20" /><br />
    </div>

    <div class="green">
        <button id="btn3">click me3</button>
        <button id="btn4">click me4</button>
    </div>
    <script src="./dist/tracker.min.js"></script>
    <script>
        Tracker
            .config({
                per: 0.9,
            })
            .install();

        const xx = () => {
            console.log(11);
        }

        document.getElementsByClassName('red')[0].addEventListener('click', function (event) {
            console.log('click');
        });

        document['body'].addEventListener('click', function (event) {
            console.log('document body');
        });

        document.addEventListener('click', function (event) {
            console.log('document');
        });

        window.addEventListener('click', function (event) {
            console.log('window');
        })

        document.getElementById('btn1').addEventListener('click', xx);
        document.getElementById('btn2').addEventListener('click', xx);
        document.getElementById('btn3').addEventListener('click', xx);

        document.getElementById('btn4').addEventListener('click', () => {
            document.getElementById('btn1').removeEventListener('click', xx);
            document.getElementById('btn2').removeEventListener('click', xx);
        });
    </script>
</body>

</html>